home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / enemy / BomberA.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  21.7 KB  |  731 lines

  1. class classes.enemy.BomberA
  2. {
  3.    var x;
  4.    var y;
  5.    var moveScript;
  6.    var matrixCoords;
  7.    var form;
  8.    var id;
  9.    var clip;
  10.    var colorR;
  11.    var trans;
  12.    var colorTrans;
  13.    var advanceMax;
  14.    var advanceMax2;
  15.    var matrixVar;
  16.    var bomb;
  17.    var laser;
  18.    var dir;
  19.    var axis;
  20.    var xDest;
  21.    var yDest;
  22.    var oldDir;
  23.    var xMov = 0;
  24.    var yMov = 0;
  25.    var xMovT = 0;
  26.    var yMovT = 0;
  27.    var speedOrig = 7;
  28.    var speed = 7;
  29.    var f2 = "";
  30.    var xDestMet = false;
  31.    var yDestMet = false;
  32.    var c = 0;
  33.    var feelerInfo = [[-400,0,400,40],[0,0,400,40],[0,-400,40,400],[0,0,40,400]];
  34.    var dirArray = ["L","R","U","D"];
  35.    var life = 40;
  36.    var nudging = false;
  37.    var nc = 0;
  38.    var xA = 0;
  39.    var yA = 0;
  40.    var power = 35;
  41.    var hc = 0;
  42.    var Name = "bomberA";
  43.    function BomberA(px, py, pmoveScript, pmatrixCoords, pform, pid)
  44.    {
  45.       this.x = px;
  46.       this.y = py;
  47.       this.moveScript = pmoveScript.slice();
  48.       this.matrixCoords = pmatrixCoords.slice();
  49.       this.form = pform.slice();
  50.       this.id = pid;
  51.       _root.d = _root.d + 1;
  52.       this.clip = _root.attachMovie("bomberA","bomberA" + this.id + "Clip",_root.d + 50000);
  53.       this.clip._x = this.x;
  54.       this.clip._y = this.y;
  55.       this.speed *= _root.dif.speed;
  56.       this.speedOrig = this.speed;
  57.       this.life *= _root.dif.life;
  58.       this.colorR = _root.randRange(10,30);
  59.       this.trans = new flash.geom.Transform(this.clip);
  60.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,this.colorR,this.colorR,this.colorR,0);
  61.       this.trans.colorTransform = this.colorTrans;
  62.       this.advanceMax = 60 / (this.speed / 2);
  63.       this.advanceMax2 = 50 / (this.speed / 2);
  64.       if(this.matrixCoords[0] == "free")
  65.       {
  66.          this.matrixVar = 0;
  67.       }
  68.       else
  69.       {
  70.          this.matrixVar = 1;
  71.       }
  72.       this.speedVar();
  73.       this.bomb = new Object();
  74.       this.laser = new Object();
  75.       this.parseMoveScript();
  76.       _root.stats.created = _root.stats.created + 1;
  77.    }
  78.    function broBehind()
  79.    {
  80.       this.dir = _root.advanceDir;
  81.    }
  82.    function bombed(num)
  83.    {
  84.       this.f2 = "death";
  85.    }
  86.    function nudge(pxA, pyA, pscale)
  87.    {
  88.       this.nc = 0;
  89.       this.nudging = true;
  90.       var _loc2_ = pscale / 100;
  91.       this.xA = pxA * _loc2_;
  92.       this.yA = pyA * _loc2_;
  93.    }
  94.    function speedVar()
  95.    {
  96.       if(random(3) == 1)
  97.       {
  98.          this.speed *= _root.randRange2(0.9999,1.0001);
  99.       }
  100.    }
  101.    function parseMoveScript()
  102.    {
  103.       this.dir = this.moveScript[0];
  104.       if(this.dir == "break")
  105.       {
  106.          delete this.moveScript;
  107.          if(this.matrixCoords[0] == "free")
  108.          {
  109.             this.f2 = "wander";
  110.             this[this.axis + "MovT"] = 0;
  111.             this.axis = random(10) <= 4 ? "y" : "x";
  112.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  113.             this.speedVar();
  114.             this.getDirString();
  115.          }
  116.          else
  117.          {
  118.             this[this.axis + "MovT"] = 0;
  119.             this.xDest = _root.advanceDir != "L" ? this.matrixCoords[0] * 60 : this.matrixCoords[0] * 60 + 320;
  120.             this.yDest = this.matrixCoords[1] * 50 + 10;
  121.             this.axis = Math.abs(this.xDest - this.x) <= Math.abs(this.yDest - this.y) ? "y" : "x";
  122.             this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  123.             this.getDirString();
  124.             this.speedVar();
  125.             this.f2 = "gotoMatrix";
  126.          }
  127.       }
  128.       else
  129.       {
  130.          this[this.axis + "MovT"] = 0;
  131.          this.f2 = "gotoXYDest";
  132.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  133.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  134.          this.speedVar();
  135.          if(this.dir == "L" || this.dir == "U")
  136.          {
  137.             this[this.axis + "Dest"] = this[this.axis] - this.moveScript[1];
  138.          }
  139.          else
  140.          {
  141.             this[this.axis + "Dest"] = this[this.axis] + this.moveScript[1];
  142.          }
  143.          this.moveScript.splice(0,2);
  144.       }
  145.    }
  146.    function gotoXYDest()
  147.    {
  148.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  149.       {
  150.          if(this.axis == "x")
  151.          {
  152.             this.x = this.xDest;
  153.          }
  154.          else
  155.          {
  156.             this.y = this.yDest;
  157.          }
  158.          this.parseMoveScript();
  159.       }
  160.    }
  161.    function gotoMatrix()
  162.    {
  163.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  164.       {
  165.          if(this.axis == "x")
  166.          {
  167.             this.x = this.xDest;
  168.          }
  169.          else
  170.          {
  171.             this.y = this.yDest;
  172.          }
  173.          this[this.axis + "MovT"] = 0;
  174.          this.axis = this.axis != "x" ? "x" : "y";
  175.          this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  176.          this.getDirString();
  177.          this.speed = this.speedOrig;
  178.       }
  179.       if(Math.abs(this.x - this.xDest) < this.speed + 1 && Math.abs(this.y - this.yDest) < this.speed + 1)
  180.       {
  181.          this.x = this.clip._x = this.xDest;
  182.          this.y = this.clip._y = this.yDest;
  183.          this.xMovT = this.xMov = 0;
  184.          this.yMovT = this.yMov = 0;
  185.          this.matrixVar = 2;
  186.          this.dir = _root.advanceDir;
  187.          this.clip.flame.gotoAndStop("D");
  188.          _root.matrixNum = _root.matrixNum + 1;
  189.          if(_root.matrixNum >= _root.matrixSize)
  190.          {
  191.             _root.matrixComplete = true;
  192.          }
  193.          _root["formB" + this.form[0]] = "matrixed";
  194.          this.f2 = "wait";
  195.       }
  196.    }
  197.    function getDirString()
  198.    {
  199.       if(this.xMovT < -1)
  200.       {
  201.          this.dir = "L";
  202.       }
  203.       else if(this.xMovT > 1)
  204.       {
  205.          this.dir = "R";
  206.       }
  207.       else if(this.yMovT > 1)
  208.       {
  209.          this.dir = "D";
  210.       }
  211.       else if(this.yMovT < -1)
  212.       {
  213.          this.dir = "U";
  214.       }
  215.    }
  216.    function evade()
  217.    {
  218.       if(this.matrixVar == 2)
  219.       {
  220.          this.matrixVar = 0;
  221.          this.f2 = "wander";
  222.          this.axis = random(10) <= 4 ? "y" : "x";
  223.          this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  224.          this.speedVar();
  225.          this.getDirString();
  226.       }
  227.       else if(this.f2 != "laserScoping" || !this.laser.firing)
  228.       {
  229.          this.newDir();
  230.       }
  231.    }
  232.    function wait()
  233.    {
  234.       if(random(200) >= 197 + _root.dif.wait && _root.matrixComplete && !this.laser.firing)
  235.       {
  236.          this.dir = this.findDir();
  237.          if(this.dir == _root.advanceDir)
  238.          {
  239.             if(random(10) > 8)
  240.             {
  241.                this.matrixVar = 0;
  242.                this.xMovT = _root.advanceDir != "L" ? this.speed : -1 * this.speed;
  243.                if(random(2) > 0)
  244.                {
  245.                   this.clip.flame.gotoAndStop(_root.advanceDir);
  246.                   this.f2 = "wander";
  247.                }
  248.                else
  249.                {
  250.                   this.bombRaid();
  251.                }
  252.             }
  253.             else if(random(10) > 8)
  254.             {
  255.                this.laser.dir = _root.advanceDir;
  256.                this.fireLaser(true);
  257.             }
  258.          }
  259.          else if(this.dir == "U" || this.dir == "D")
  260.          {
  261.             if(random(10) > 8)
  262.             {
  263.                this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  264.                this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  265.                this.matrixVar = 0;
  266.                this.c = 0;
  267.                this.f2 = "leavingMatrix";
  268.             }
  269.             else if(random(2) > 0)
  270.             {
  271.                this.bomb.dir = this.dir;
  272.                this.ejectBomb();
  273.                this.dir = _root.advanceDir;
  274.             }
  275.          }
  276.          else
  277.          {
  278.             this.dir = _root.advanceDir;
  279.          }
  280.       }
  281.    }
  282.    function leavingMatrix()
  283.    {
  284.       this.c = this.c + 1;
  285.       if(this.c > this.advanceMax2)
  286.       {
  287.          this.c = 0;
  288.          this.dir = this.findDir();
  289.          if(this.dir == _root.advanceDir)
  290.          {
  291.             this.yMovT = 0;
  292.             this.xMovT = _root.advanceDir != "L" ? this.speed : -1 * this.speed;
  293.             if(random(2) > 0)
  294.             {
  295.                this.f2 = "wander";
  296.             }
  297.             else
  298.             {
  299.                this.bombRaid();
  300.             }
  301.          }
  302.       }
  303.    }
  304.    function findDir()
  305.    {
  306.       _root.d = _root.d + 1;
  307.       _root.attachMovie("feeler","feelerClip",_root.d);
  308.       var _loc7_ = [];
  309.       var _loc9_ = 0;
  310.       var _loc11_ = this.dirArray.length;
  311.       while(_loc9_ < _loc11_)
  312.       {
  313.          _root.feelerClip._x = this.x + this.feelerInfo[_loc9_][0];
  314.          _root.feelerClip._y = this.y + this.feelerInfo[_loc9_][1];
  315.          _root.feelerClip._width = this.feelerInfo[_loc9_][2];
  316.          _root.feelerClip._height = this.feelerInfo[_loc9_][3];
  317.          var _loc3_ = 0;
  318.          var _loc8_ = _root.chars.length;
  319.          var _loc6_ = false;
  320.          while(_loc3_ < _loc8_)
  321.          {
  322.             var _loc5_ = _root.chars[_loc3_] + "Clip";
  323.             if(_root.feelerClip.hitTest(_root[_loc5_]))
  324.             {
  325.                var _loc4_ = _root.chars[_loc3_];
  326.                if(_root[_loc4_].matrixVar == 2 && _loc4_ != this.Name + this.id)
  327.                {
  328.                   _loc6_ = true;
  329.                   break;
  330.                }
  331.             }
  332.             _loc3_ = _loc3_ + 1;
  333.          }
  334.          if(!_loc6_)
  335.          {
  336.             var _loc10_ = _root.advanceDir != "L" ? "L" : "R";
  337.             if(this.dirArray[_loc9_] != _loc10_)
  338.             {
  339.                _loc7_.push(this.dirArray[_loc9_]);
  340.             }
  341.          }
  342.          _loc9_ = _loc9_ + 1;
  343.       }
  344.       _loc9_ = 0;
  345.       _loc11_ = _loc7_.length;
  346.       if(_loc9_ < _loc11_)
  347.       {
  348.          if(_loc7_[_loc9_] == _root.advanceDir)
  349.          {
  350.             return _root.advanceDir;
  351.          }
  352.          return _loc7_[random(_loc7_.length)];
  353.       }
  354.    }
  355.    function death()
  356.    {
  357.       _root.stats.destroyed = _root.stats.destroyed + 1;
  358.       _root.stats.score += 7500;
  359.       _root.powerUp(this.x,this.y,94);
  360.       if(this.matrixVar == 1)
  361.       {
  362.          _root.matrixNum = _root.matrixNum + 1;
  363.          if(_root.matrixNum >= _root.matrixSize)
  364.          {
  365.             _root.matrixComplete = true;
  366.          }
  367.       }
  368.       var _loc3_ = 0;
  369.       var _loc4_ = _root["form" + this.form[0]].length;
  370.       while(_loc3_ < _loc4_)
  371.       {
  372.          if(_root["form" + this.form[0]][_loc3_] == "bomberA" + this.id)
  373.          {
  374.             _root["form" + this.form[0]].splice(_loc3_,1);
  375.             if(_root["form" + this.form[0]].length == 0)
  376.             {
  377.                delete _root["form" + this.form[0]];
  378.                if(_root["formB" + this.form[0]] == "matrixed")
  379.                {
  380.                   _loc3_ = 0;
  381.                   _loc4_ = random(2) + 1;
  382.                   while(_loc3_ < _loc4_)
  383.                   {
  384.                      _root.createPowerUp([this.x,this.y,"coin10"]);
  385.                      _loc3_ = _loc3_ + 1;
  386.                   }
  387.                   _root.stats.score += 7500;
  388.                }
  389.                else
  390.                {
  391.                   _loc3_ = 0;
  392.                   _loc4_ = random(2) + 2;
  393.                   while(_loc3_ < _loc4_)
  394.                   {
  395.                      _root.createPowerUp([this.x,this.y,"coin10"]);
  396.                      _loc3_ = _loc3_ + 1;
  397.                   }
  398.                   _root.stats.score += 15000;
  399.                }
  400.                delete _root["formB" + this.form[0]];
  401.             }
  402.             break;
  403.          }
  404.          _loc3_ = _loc3_ + 1;
  405.       }
  406.       _root.createExploA([this.x + this.clip._width / 2,this.y + this.clip._height / 2,_root.randRange(80,130),_root.randRange(75,100),"Green"]);
  407.       _root.audio.playLevel4("bomberX" + (random(3) + 1),_root.randRange(5,13));
  408.       var _loc5_ = 0;
  409.       var _loc6_ = random(3);
  410.       while(_loc5_ < _loc6_)
  411.       {
  412.          _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"bomberA","Blue"]);
  413.          _loc5_ = _loc5_ + 1;
  414.       }
  415.       _root.createEnemySoul([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"green"]);
  416.       _root.removeChar("bomberA" + this.id);
  417.       this.f2 = "";
  418.    }
  419.    function advance()
  420.    {
  421.       this.dir = _root.advanceDir;
  422.       this.xMovT = _root.advanceDir != "L" ? 1 * (this.speed / 2) : -1 * (this.speed / 2);
  423.       this.clip.flame.gotoAndStop(_root.advanceDir);
  424.       this.clip.flame._alpha = 50;
  425.       this.f2 = "advancing";
  426.    }
  427.    function advancing()
  428.    {
  429.       this.c = this.c + 1;
  430.       if(this.c > this.advanceMax)
  431.       {
  432.          this.xMovT = 0;
  433.          this.c = 0;
  434.          this.f2 = "wait";
  435.          this.clip.flame.gotoAndStop("D");
  436.          this.clip.flame._alpha = 100;
  437.          _root.d = _root.d + 1;
  438.          _root.attachMovie("sight","sightClip",_root.d);
  439.          _root.sightClip.gotoAndStop("hindSight");
  440.          _root.sightClip._x = this.x;
  441.          _root.sightClip._y = this.y;
  442.          if(_root.advanceDir == "L")
  443.          {
  444.             _root.sightClip._rotation = 180;
  445.          }
  446.          if(_root.sightClip.hitTest(_root[_root.char].x,_root[_root.char].y,true))
  447.          {
  448.             _root.broBehind();
  449.          }
  450.          removeMovieClip(_root.sightClip);
  451.       }
  452.    }
  453.    function newDir()
  454.    {
  455.       if(random(10) > 1 + _root.dif.wander)
  456.       {
  457.          this[this.axis + "MovT"] = 0;
  458.          this.dir = _root.getDir(this.x,this.y);
  459.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  460.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  461.       }
  462.       else
  463.       {
  464.          this[this.axis + "MovT"] = 0;
  465.          this.axis = random(10) <= 4 ? "y" : "x";
  466.          this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  467.          this.getDirString();
  468.       }
  469.    }
  470.    function wander()
  471.    {
  472.       if(random(100) > 97 + _root.dif.wander)
  473.       {
  474.          this.newDir();
  475.       }
  476.       else if(random(200) > 195)
  477.       {
  478.          if(this.dir == "L" || this.dir == "R")
  479.          {
  480.             this.bomb.dir = _root[_root.char].y >= this.y ? "D" : "U";
  481.             this.ejectBomb();
  482.          }
  483.          else
  484.          {
  485.             this.laserScope();
  486.          }
  487.       }
  488.    }
  489.    function bombRaid()
  490.    {
  491.       this.clip.gotoAndPlay("raid" + this.dir);
  492.       this.bomb.c = 0;
  493.       this.bomb.cMax = _root.randRange(5,10);
  494.       this.bomb.cMax *= 1 / _root.dif.speed;
  495.       this.bomb.dir = _root[_root.char].y >= this.y ? "D" : "U";
  496.       this.f2 = "bombRaiding";
  497.    }
  498.    function bombRaiding()
  499.    {
  500.       this.xMovT *= 1.02;
  501.       this.bomb.c = this.bomb.c + 1;
  502.       if(this.bomb.c >= this.bomb.cMax)
  503.       {
  504.          this.bomb.c = 0;
  505.          this.bomb.cMax = _root.randRange(12,20);
  506.          this.bomb.cMax *= 1 / _root.dif.speed;
  507.          this.ejectBomb();
  508.       }
  509.    }
  510.    function ejectBomb()
  511.    {
  512.       this.clip.bomb.gotoAndPlay("eject" + this.bomb.dir);
  513.       _root.enemyShotID = _root.enemyShotID + 1;
  514.       _root["bomberABomb" + _root.enemyShotID] = new classes.shots.BomberABomb(this.x + 6,this.y + 6,this.xMovT,this.bomb.dir,_root.enemyShotID);
  515.       _root.addEnemyShot("bomberABomb" + _root.enemyShotID);
  516.       _root.audio.playLevel4("bomberLaunch" + (random(3) + 1),_root.randRange(9,14));
  517.    }
  518.    function laserScope()
  519.    {
  520.       this.laser.c = 0;
  521.       this.laser.c2 = 0;
  522.       this.laser.c2Max = _root.randRange(2,4);
  523.       this.f2 = "laserScoping";
  524.       this.speed /= 3;
  525.       this[this.axis + "MovT"] /= 3;
  526.       this.clip.body.flame._alpha = 50;
  527.       this.clip.eyes.gotoAndPlay("spin");
  528.    }
  529.    function laserScoping()
  530.    {
  531.       this.laser.c = this.laser.c + 1;
  532.       if(this.laser.c == 30)
  533.       {
  534.          this.laser.c2 = this.laser.c2 + 1;
  535.          _root.d = _root.d + 1;
  536.          _root.attachMovie("sight","sightClip",_root.d);
  537.          _root.sightClip.gotoAndStop("bomberALaser");
  538.          _root.sightClip._x = this.x;
  539.          _root.sightClip._y = this.y;
  540.          if(_root.sightClip.hitTest(_root[_root.char].x,_root[_root.char].y,true))
  541.          {
  542.             this.laser.dir = "L";
  543.             this.fireLaser(false);
  544.          }
  545.          else
  546.          {
  547.             _root.sightClip._rotation = 180;
  548.             if(_root.sightClip.hitTest(_root[_root.char].x,_root[_root.char].y,true))
  549.             {
  550.                this.laser.dir = "R";
  551.                this.fireLaser(false);
  552.             }
  553.          }
  554.          removeMovieClip(_root.sightClip);
  555.          this.laser.c = 0;
  556.       }
  557.       if(this.laser.c2 == this.laser.c2Max)
  558.       {
  559.          this.speed = this.speedOrig;
  560.          this[this.axis + "MovT"] *= 3;
  561.          this.clip.body.flame._alpha = 100;
  562.          this.f2 = "wander";
  563.       }
  564.    }
  565.    function fireLaser(pmatrixed)
  566.    {
  567.       this.laser.matrixed = pmatrixed;
  568.       this.f2 = "";
  569.       this.clip.laser.gotoAndPlay("fire" + this.laser.dir);
  570.       this.clip.eyes.gotoAndStop(this.laser.dir);
  571.       this.laser.l = _root.randRange(8,20);
  572.       this.laser.firing = true;
  573.       this.laser.c = 0;
  574.    }
  575.    function stopLaserFire()
  576.    {
  577.       this.laser.firing = false;
  578.       this.clip.laser.gotoAndPlay("endFire" + this.laser.dir);
  579.       if(!this.laser.matrixed)
  580.       {
  581.          this.speed = this.speedOrig;
  582.          this[this.axis + "MovT"] *= 3;
  583.          this.clip.body.flame._alpha = 100;
  584.          this.f2 = "wander";
  585.       }
  586.    }
  587.    function death2()
  588.    {
  589.       _root.removeChar("bomberA" + this.id);
  590.       this.f2 = "";
  591.    }
  592.    function main()
  593.    {
  594.       this[this.f2]();
  595.       if(this.oldDir != this.dir)
  596.       {
  597.          if(this.f2 != "wait")
  598.          {
  599.             this.clip.flame.gotoAndStop(this.dir);
  600.          }
  601.          if(this.oldDir == undefined || this.dir == "F")
  602.          {
  603.             this.clip.eyes.gotoAndStop(this.dir);
  604.          }
  605.          else if(this.dir == "U" || this.dir == "D")
  606.          {
  607.             this.clip.eyes.gotoAndStop(this.oldDir);
  608.          }
  609.          else if(random(3) > 0)
  610.          {
  611.             if(this.f2 != "wait")
  612.             {
  613.                this.clip.flame.flame1.gotoAndPlay("start1");
  614.             }
  615.             if(this.dir == "R")
  616.             {
  617.                this.clip.eyes.gotoAndPlay("LtoR");
  618.             }
  619.             else
  620.             {
  621.                this.clip.eyes.gotoAndPlay("RtoL");
  622.             }
  623.          }
  624.          else
  625.          {
  626.             if(this.f2 != "wait")
  627.             {
  628.                this.clip.flame.flame1.gotoAndPlay("start2");
  629.             }
  630.             this.clip.eyes.gotoAndPlay("spin" + this.dir);
  631.          }
  632.       }
  633.       this.oldDir = this.dir;
  634.       if(this.laser.firing)
  635.       {
  636.          this.laser.c = this.laser.c + 1;
  637.          if(this.laser.c == 20)
  638.          {
  639.             var _loc9_ = this.laser.dir != "L" ? 18 : -25;
  640.             _root["bomberALaser" + this.id] = new classes.shots.BomberALaser(this.x + _loc9_,this.y - 3,this.laser.dir,this.laser.l,this.id);
  641.             _root.addEnemyShot("bomberALaser" + this.id);
  642.             _root.audio.playLevel3("bomberALaser",_root.randRange(15,22));
  643.          }
  644.       }
  645.       if(this.nudging)
  646.       {
  647.          this.xA *= 0.5;
  648.          this.yA *= 0.5;
  649.          this.nc = this.nc + 1;
  650.          var _loc8_ = 255 - this.nc * 17;
  651.          this.colorTrans.redOffset = _loc8_;
  652.          this.colorTrans.greenOffset = _loc8_ * 0.75;
  653.          this.trans.colorTransform = this.colorTrans;
  654.          if(this.nc == 15)
  655.          {
  656.             this.xA = this.yA = 0;
  657.             this.nudging = false;
  658.             this.colorTrans.redOffset = this.colorR;
  659.             this.colorTrans.greenOffset = this.colorR;
  660.             this.trans.colorTransform = this.colorTrans;
  661.          }
  662.       }
  663.       var _loc4_ = 0;
  664.       var _loc7_ = _root.broShots.length;
  665.       while(_loc4_ < _loc7_)
  666.       {
  667.          var _loc6_ = _root.broShots[_loc4_] + "Clip";
  668.          if(this.clip.hitTest(_root[_loc6_]))
  669.          {
  670.             var _loc3_ = _root.broShots[_loc4_];
  671.             var _loc5_ = this.life;
  672.             this.life -= _root[_loc3_].power;
  673.             if(this.life < 1)
  674.             {
  675.                this.f2 = "death";
  676.             }
  677.             else
  678.             {
  679.                this.nudge(_root[_loc3_].xMov,_root[_loc3_].yMov,5);
  680.                _root.audio.playLevel4("bomberHit" + (random(3) + 1),_root.randRange(5,11));
  681.             }
  682.             _root[_root.char].fc = _root[_root.char].fireFreq - _root.rapidVar;
  683.             _root[_loc3_].exploX = this.x + this.clip._width / 2;
  684.             _root[_loc3_].exploY = this.y + this.clip._height / 2;
  685.             _root[_loc3_].hit(_loc5_);
  686.             break;
  687.          }
  688.          _loc4_ = _loc4_ + 1;
  689.       }
  690.       if(this.clip.hitTest(_root[_root.char + "Clip"]))
  691.       {
  692.          _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
  693.          this.f2 = "death";
  694.       }
  695.       if(this.x > 1050 || this.x < -50 || this.y < -50 || this.y > 650)
  696.       {
  697.          delete _root["form" + this.form[0]];
  698.          delete _root["formB" + this.form[0]];
  699.          this.f2 = "death2";
  700.       }
  701.       if(this.xMovT < this.xMov)
  702.       {
  703.          this.xMov -= 1;
  704.       }
  705.       else if(this.xMovT > this.xMov)
  706.       {
  707.          this.xMov += 1;
  708.       }
  709.       else
  710.       {
  711.          this.xMov = this.xMovT;
  712.       }
  713.       if(this.yMovT < this.yMov)
  714.       {
  715.          this.yMov -= 1;
  716.       }
  717.       else if(this.yMovT > this.yMov)
  718.       {
  719.          this.yMov += 1;
  720.       }
  721.       else
  722.       {
  723.          this.yMov = this.yMovT;
  724.       }
  725.       this.x += this.xMov + this.xA;
  726.       this.y += this.yMov + this.yA + 0.5 * Math.sin(this.hc += 0.1);
  727.       this.clip._x = this.x;
  728.       this.clip._y = this.y;
  729.    }
  730. }
  731.